package com.mastercard.labs

import java.util.Date;

class Target {
	public static enum Type {INDIVIDUAL('Card'), ALL('All')
		final String value
		String toString(){value}
		Type(String value){this.value = value}
		String getKey(){ name() }
	}
	
	public static enum TargetType {WEEKLY ('Weekly'), MONTHLY('Monthly'), CUSTOMIZE ('Customize')
		final String value
		String toString(){value}
		TargetType(String value){this.value = value}
		String getKey() { name() }
	}
	static constraints = {
		type nullable: false, blank: false
		targetType nullable: false, blank: false
		user nullable:false, blank: false
		amount nullable: false, range:1..100000000
		billDate range:1..31
	}
	User user
	Date startDate
	Date endDate
	double amount
	int billDate = 1
	boolean smsNotification
	boolean emailNotification
	Card card // Budget for specific card
	Type type // Can be INDIVIDUAL/ALL
	TargetType targetType
	boolean recursive = false
	boolean deleted
	
}
